function obj = LockXe131(obj, varargin)
    L = log4m.getLogger;
    p=inputParser;
    p.addParameter('pVal', -200e-6, @isnumeric);
    p.addParameter('iVal', -60e-6, @isnumeric);
    p.parse(varargin{:});
    
    obj.ziSlave.setPIDMode('3', 0);
    obj.ziSlave.setPIDInput('3', 3); % DemodPhase
    obj.ziSlave.setPIDInputChannel('3', 3); % ziDemod '3'
    obj.ziSlave.setPIDSetpoint('3', -90.0);
    obj.ziSlave.disablePIDPhaseUnwarp('3');
    obj.ziSlave.setPIDOutput('3', 2); % osc freq
    obj.ziSlave.setPIDOutputChannel('3', 1);
    obj.ziSlave.setPIDCenter('3', obj.Xe131FIDSignal.fft.center);
    obj.ziSlave.setPIDLimLower('3', -50e-3);
    obj.ziSlave.setPIDLimUpper('3', 50e-3);
    obj.ziSlave.setPValue('3', p.Results.pVal);
    obj.ziSlave.setIValue('3', p.Results.iVal);
    obj.ziSlave.setDValue('3', 0.0);
    obj.ziSlave.setDLimValue('3', 0.0);
    obj.ziSlave.setRateValue('3', 2e6);
    obj.ziSlave.lock('3');
    L.info('ParametricMagnetometer::LockXe131', sprintf('Xe131 is locked: Px=[%5.3e], Ix=[%5.3e]', p.Results.pVal, p.Results.iVal));
end

